package com.sss.hloster0507;

public class DaemonThread {

	public static void main(String[] args) {
		DThread t = new DThread();
		t.start();
		System.out.println("让一切都结束吧 ！！");
	}

	private static class DThread extends Thread {
		// 在无参构造方法中设置本线程为守护线程

		public DThread() {
			setDaemon(true);
		}

		public void run() {
		
			while (true) {
				System.out.println("后台线程在此！！");
			}
		}
	}
}
